<template>
  <div>
    <h1 ref="hh">Child</h1>
    <h1>{{ props.count }}</h1>
    <button @click="fn()">Click me</button>
    <el-button ref="btn">click</el-button>
  </div>
</template>

<script setup>
import { defineProps, defineEmits,ref,onMounted } from "vue";
import {useRouter,useRoute} from "vue-router";
import {useStore} from 'vuex';

const store=useStore()      //获取vuex对象 //this.$store
console.log(store);


const router=useRouter()    //获取路由对象 //this.$router
const route=useRoute()      //获取当前路由信息 //this.$route
console.log(router,route);


const hh=ref(null)
const btn=ref(null)
onMounted(()=>{
    console.log(hh.value);

})

// const props=defineProps(['count'])

const props = defineProps({
  count: {
    type: Number,
    required: true,
  },
});

const emit = defineEmits(['add']); //this.$emit()

const fn = () => {
    emit("add", 100);
};

</script>
